package com.gkjsj.exam1;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import 
    org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestDemo {
	public static void main(String[] args) {
		String xml = "com.gkjsj.exam1.beans.xml";
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xml);
		Teacher t1 = (Teacher)applicationContext.getBean("teacher1");
		
		System.out.println(t1);
		System.out.println(applicationContext.getBean("teacher2"));
		((ConfigurableApplicationContext) applicationContext).close();
	}
}
